<include file="./Application/Admin/View/Public/htmlheader.html" />
<include file="./Application/Admin/View/Public/header.html" />
<include file="./Application/Admin/View/Public/left.html" />

<ol class="breadcrumb">
    <li><a href="/Admin/User/userList">用户列表</a></li>
    <li class="active">提现</li>
</ol>

<form action="/Admin/Gift/saveFordCash" method="post">
    <input type="hidden" name="id" value="{$userInfo['id']}">
    <input type="hidden" name="fordToRMB" id="fordToRMB" value="{$fordToRMB}">
    <div class="row">
        <div class="col-lg-3 text-right">用户名：</div>
        <div class="col-lg-3">{$userInfo['username']}</div>
    </div>
    <br />
    <div class="row">
        <div class="col-lg-3 text-right">昵称：</div>
        <div class="col-lg-3">{$userInfo['nickname']}</div>
    </div>
    <br />
    <div class="row">
        <div class="col-lg-3 text-right">可兑换福特值：</div>
        <div class="col-lg-3"><span id="fordAvailable">{$userInfo['fordAvailable']}</span></div>
    </div>
    <br />
    <div class="row">
        <div class="col-lg-3 text-right">兑换：</div>
        <div class="col-lg-2">
            <div class="input-group">
                <input type="text" dir="rtl" name="fordValue" id="fordValue" value="{$userInfo['fordAvailable']}" class="form-control">
                <span class="input-group-addon">福特值</span>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-lg-3 text-right">人民币：</div>
        <div class="col-lg-2">
            <div class="input-group">
                <input type="text" dir="rtl" id="rmb" name="rmb" class="form-control" readonly />
                <span class="input-group-addon">元</span>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-lg-3"></div>
        <div class="col-lg-3"><button type="submit" class="btn btn-primary">确定</button></div>
    </div>
</form>

<script>
    $(function(){
        var fordAvailable = $('#fordAvailable').text();
        var fordToRMB = $('#fordToRMB').val();
        var rmb = (fordAvailable / fordToRMB).toFixed(2);
        $('#rmb').val(rmb);
    });

    $('#fordValue').keyup(function(){
        var fordAvailable = $('#fordAvailable').text();
        var value = $(this).val();
        if(value > fordAvailable){
            $(this).val(fordAvailable);
            value = fordAvailable;
        }

        var fordToRMB = $('#fordToRMB').val();
        var rmb = (value / fordToRMB).toFixed(2);
        $('#rmb').val(rmb);
    })
</script>
<include file="./Application/Admin/View/Public/footer.html" />